/**
  ************************************* Copyright ******************************
  * FileName   : tim_delay.c
  * Version    : v1.0
  * Author     : yychao
  * Date       : 2023-01-30
  * Description:
  * Function List:
  	1. ....
  	   <version>:
  <modify staff>:
  		  <data>:
   <description>:
  	2. ...
  ******************************************************************************
 */
#include "tim_delay.h"
#include "tim.h"
#include <n32g45x_tim.h>

uint8_t delay_us(uint16_t us)
{
    TIM8->CNT = 0;
    TIM_Enable(TIM8,ENABLE);
    while(TIM8->CNT < us);
    TIM_Enable(TIM8,DISABLE);
}